package com.tengju.data.infrastructure.kafka.convert;

import com.alibaba.otter.canal.protocol.FlatMessage;
import com.tengju.data.domain.model.cdc.CDCEvent;

public class EventConvert {

    public static CDCEvent binlogMsgToEvent(FlatMessage message) {
        CDCEvent event = new CDCEvent();
        event.setId(message.getId());
        event.setTable(message.getTable());
        event.setOld(message.getOld());
        event.setData(message.getData());
        event.setEventTs(message.getTs());
        return event;
    }
}
